package sziit.znk.utils;

import java.io.IOException;
import java.util.Properties;

public class JDBCPropertiesFilesLoader {

    private String URL = null;
    private String USER = null;
    private String PASSWORD = null;
    private String DRIVER_CLASS = null;
    private Properties properties = null;
    private String name = null;

    public String getURL() {
        return URL;
    }

    public String getUSER() {
        return USER;
    }

    public String getPASSWORD() {
        return PASSWORD;
    }

    public String getDRIVER_CLASS() {
        return DRIVER_CLASS;
    }

    public JDBCPropertiesFilesLoader(String name) {
        this.name = name;
        try {
            properties = new Properties();
            properties.load(JDBCPropertiesFilesLoader.class.getClassLoader().getResourceAsStream(name));
            URL = properties.getProperty("URL");
            USER = properties.getProperty("USER");
            PASSWORD = properties.getProperty("PASSWORD");
            DRIVER_CLASS = properties.getProperty("DRIVER_CLASS");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
